[sed || gawk]: find and delete blocks and lines from file
I have a file named foo.bar
It consists of something like this:
[foo1]
barbarbar=bbaar
barbar=bbarr
bar=baarr
[foo2]
barbar=bbaarrbbaarr
I need to locate and remove either anything from [foo1] to [foo2], OR barbar= ONLY in block [foo2]. How do i do this by sed or awk?
|